﻿CREATE TABLE [dbo].[Sessions]
(
	[Id] UNIQUEIDENTIFIER NOT NULL PRIMARY KEY, 
    [StartDate] DATETIME NULL, 
    [EndDate] DATETIME NULL, 
    [IdUser] UNIQUEIDENTIFIER NULL, 
    [IdApplication] UNIQUEIDENTIFIER NOT NULL, 
    CONSTRAINT [FK_Sessions_ToTable] FOREIGN KEY ([IdUser]) REFERENCES [Users]([Id]), 
    CONSTRAINT [FK_Sessions_ToApplication] FOREIGN KEY (IdApplication) REFERENCES [Applications]([Id])
)
